import { http } from '@/utils/http'
// API响应接口
interface ApiResponse<T> {
  code: number
  type: string
  message: string
  result: T
  extras: string
  time: string
}

// 用户信息接口
interface UserInfo {
  name: string
  account: string
  password: string
  avatar: string
  status: number
  mobile: string
  token: string
}

export interface ILogin {
  username: string
  password: string
}

// 用户信息响应类型
export type UserInfoResponse = ApiResponse<UserInfo>
/** GET 请求 */
export const Login = (loginModel: ILogin) => {
  return http.post<UserInfoResponse>('/api/login', loginModel)
}
